package app.base.root;

import java.util.Map;

import org.apache.velocity.VelocityContext;

import app.base.commons.*;

public class Header {
	public static String renderTo(Map<String, Object> params) throws Throwable {
		VelocityContext context = new VelocityContext();
	
		context.put("APP_DOMAIN_NAME", Constants.APP_DOMAIN_NAME);
		context.put("SERVLET_CONTEXT_PATH", Constants.SERVLET_CONTEXT_PATH);
		context.put("VELOCITY_VM_PATH", Constants.VELOCITY_VM_PATH);
	
		context.put("HOOK_TOP", Tools.hookExecModule("HOOK_TOP", params));
		context.put("HOOK_LEFT_COLUMN", Tools.hookExecModule("HOOK_LEFT_COLUMN", params));
	
		return Tools.velocityTranslate(
					Constants.VELOCITY_PROPERTIES_FILENAME, 
					context, 
					Constants.VELOCITY_TEMPLATES_THEMES_PATH_DEFAULT + "/header.vm"
				);		
	}
}
